<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #elem {
            width: 100px;
            height: 200px;
        }
        
    </style>
</head>
<body>
    <div id="elem" >element</div>

    <form action="#">
        <input type="radio" name="sex" id=""> 男
        <input type="radio" name="sex" id=""> 女
    </form>
    <script>
        let elem = document.getElementById('elem');

        elem.style.backgroundColor = 'pink';
        elem.style.color = 'white';
    </script>
</body>
</html>